Skip to content

fix(git): wire JvmGitRepository on desktop and keep OAuth code visible during polling#166

Merged
tstapler merged 4 commits into
mainfrom
stelekit-git-sync
Jun 18, 2026
Merged

fix(git): wire JvmGitRepository on desktop and keep OAuth code visible during polling#166
tstapler merged 4 commits into
mainfrom
stelekit-git-sync

Conversation

@tstapler

Copy link
Copy Markdown
Owner

Summary

  • Desktop Git Sync button was a no-op: Main.kt omitted gitRepository, so gitSyncService/gitConfigRepository remained null and canShowGitSetup was always false — the wizard silently never rendered. Fixed by adding remember { JvmGitRepository() } to the StelekitApp(...) call.
  • OAuth user code disappeared during polling: OAuthDialogState.Polling was a data object with no fields. Transitioning to it ~5 seconds in hid the code before users could copy or enter it. Fixed by promoting Polling to a data class carrying userCode/verificationUri/expiresAt and updating the UI branch to keep the code + copy/open buttons visible alongside a demoted "Waiting…" spinner.

Test plan

  • Desktop: click "Git Sync" in the sidebar — wizard now opens immediately
  • OAuth flow: code remains visible (and copyable) throughout the polling phase; countdown timer continues
  • GitHubDeviceFlowClientTest.OAuthDialogState_Polling_carries_code_and_expiry_fields — new state model test passes
  • ./gradlew jvmTest — all existing tests still pass

🤖 Generated with Claude Code

…e during polling

Two bugs prevented git sync from being usable on desktop:

1. Main.kt omitted `gitRepository`, keeping `gitSyncService` and
   `gitConfigRepository` null, so `canShowGitSetup` was always false
   and the Git Setup wizard never appeared.

2. `OAuthDialogState.Polling` was a data object with no fields;
   transitioning to it hid the user code ~5 seconds into the OAuth
   flow, before most users could copy or enter it.

Fixes:
- Add `remember { JvmGitRepository() }` to `StelekitApp(...)` call in
  `Main.kt` so the Git Setup wizard opens on the first click.
- Promote `OAuthDialogState.Polling` to a data class carrying
  `userCode`, `verificationUri`, and `expiresAt`.
- Update `startOAuthFlow` to pass those values into `Polling`.
- Update the `Polling` UI branch to show the code, countdown,
  copy/open buttons, and a demoted "Waiting…" spinner — identical
  to `ShowCode` but with a polling indicator.
- Add a state-model test asserting `Polling` carries its fields.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

JVM Load Benchmark (Desktop)

Synthetic in-memory benchmark measuring load performance for the desktop (JVM) app.
Comparing cd87ffea (this PR) vs 27bf06d3 (baseline)
Graph config: xlarge — 230 pages

Metric This PR Baseline Delta
Phase 1 TTI ↓ 1ms 0ms +1ms ⚠️
Phase 2 background ↓ 0ms 0ms 0 (0%)
Phase 3 index ↓ 0ms 0ms 0 (0%)
Total ↓ 1ms 0ms +1ms ⚠️
Write p95 (baseline) ↓ 44ms 20ms +24ms (+120%) ⚠️
Write p95 (under load) ↓ n/a n/a
Jank factor ↓ n/a n/a
↓ lower is better
Flamegraphs (this PR) **Allocation** — object allocation pressure (JDBC/SQLite churn)

Alloc flamegraph not available

CPU — method-level hotspots by on-CPU time

CPU flamegraph not available

Top SQL queries by total time (this PR) | table:operation | calls | p50 | p99 | max | total | |-----------------|-------|-----|-----|-----|-------| | `blocks_fts:insert` | 2 | 1ms | 1ms | 0ms | 0ms | | `pages:select` | 2 | 1ms | 1ms | 0ms | 0ms |
Top allocation hotspots (this PR) `37.4%` byte[]_[k] `7.3%` java.lang.String_[k] `7.2%` java.util.LinkedHashMap$Entry_[k] `5%` int[]_[k] `3.6%` java.lang.Object[]_[k]
Top CPU hotspots (this PR) `95%` /usr/lib/x86_64-linux-gnu/libc.so.6 `1.8%` /tmp/sqlite-3.51.3.0-ec245585-ee77-418c-a0ba-73629438397a-libsqlitejdbc.so `0.5%` pthread_cond_signal `0.2%` __libc_pwrite `0.2%` SR_handler

…howCode/Polling UI

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Android Load Benchmark

Instrumented benchmark on an API 30 x86_64 emulator — 500-page synthetic graph.

Comparing cd87ffea (this PR) vs 27bf06d3 (baseline)
Device: API 30 x86_64 emulator — 530 pages loaded

Graph Load

Metric This PR Baseline Delta
Phase 1 TTI ↓ 71ms 70ms +1ms (+1%) ⚠️
Phase 3 index ↓ 7310ms 6868ms +442ms (+6%) ⚠️

Interactive Write Latency (during Phase 3)

Metric This PR Baseline Delta
Write p95 (baseline) ↓ 13ms 13ms 0 (0%)
Write p95 (during phase 3) ↓ 24ms 27ms -3ms (-11%) ✅
Jank factor ↓ 1.85x 2.08x -0.23x (-11%) ✅
Concurrent writes ↑ 36 33 +3ms (+9%) ✅

SAF I/O Overhead (ContentProvider vs direct File read)

Measures Binder IPC cost added by ContentResolver per readFile() call.
Real SAF via ExternalStorageProvider will be higher on device; this is a lower bound.

Metric This PR Baseline Delta
Direct read / file ↓ 0.0ms 0.0ms 0ms (-100%) ✅
Provider read / file ↓ 0.2ms 0.3ms 0ms (-33%) ✅
IPC overhead ratio ↓ 6x 9x -3x (-33%) ✅
↓ lower is better · ↑ higher is better

tstapler and others added 2 commits June 17, 2026 16:30
…ry poll paths

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…eEmitters rule

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@tstapler tstapler merged commit 00df575 into main Jun 18, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant